//
//  linklistStack.swift
//  SetAndMap
//
//  Created by lhc on 2024/6/22.
//

import Foundation

class LinkListStack<E: Equatable>: LinkList<E> {
    
    /// 推入数据
    func push(e: E) {
        self.addFirst(element: e)
    }
    
    /// 推出数据
    func pop() -> E? {
        guard !self.isEmpty() else { return nil }
        
        return self.deleteFirst()
    }
}
